﻿Imports DTO
Imports System.Data.OleDb
Public Class LoaiBenhDAO
    Public Shared Function Laytenthuoc() As List(Of LoaiBenhDTO)
        Dim sql As String
        sql = "select * from LOAIBENH "
        Dim conn As OleDbConnection = Data_Provider.ConnecDTB()

        Dim command As OleDbCommand
        command = New OleDbCommand(sql, conn)

        Dim reader As OleDbDataReader = command.ExecuteReader()
        Dim ds_tenbenh As New List(Of LoaiBenhDTO)

        While reader.Read()
            Dim ts As New LoaiBenhDTO()
            ts.TenLoaiBenh = reader.GetString(1)
            ds_tenbenh.Add(ts)
        End While

        Return ds_tenbenh
    End Function
End Class
